package com.leilingmin.www.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.leilingmin.www.entity.User;
import com.leilingmin.www.mapper.UserMapper;
import org.springframework.stereotype.Service;

//User服务类
//一般被控制器调用
//控制器调用service，再由service调用数据库
@Service
public class UserService extends ServiceImpl <UserMapper, User>{
    public User findUserByUserAccount(User user){
        LambdaQueryWrapper<User> lambdaQueryWrapper=new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(User::getUserAccount,user.getUserAccount());
        return this.getOne(lambdaQueryWrapper);
    }

}
